﻿using Microsoft.EntityFrameworkCore;
using Sample.ConsoleApp.CodeFist.Sqlite.Entitys;

namespace Sample.ConsoleApp.CodeFist.Sqlite.DbContexts;

/// <summary>
/// 数据库上下文
/// </summary>
/// <param name="options"></param>
internal class MyDb2Context(DbContextOptions<MyDb2Context> options) : DbContext(options)
{
    public DbSet<MyEntity> MyEntitys { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.ApplyConfiguration(new MyEntityTypeConfiguration());

        /*
        modelBuilder.Entity<MyEntity>()
            .Property(e => e.Data)
            .HasConversion(new JsonDocumentToStringConverter());
        */
    }

}